﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace lcmyjobs.Web.reward
{
    public partial class reward_news : System.Web.UI.Page
    {
        lcmyjobs.BLL.news bn = new BLL.news();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int id = int.Parse(Application["webid"].ToString());
                DataSet dsn = bn.GetListNews(id, 20, 7);
                //DataSet dsn = bn.GetListNews(id, 6, 7);
                Repeater1.DataSource = dsn.Tables[0];
                Repeater1.DataBind();
                if (Request.QueryString["id"] != null)
                {
                    try
                    {
                        int nid = int.Parse(Request.QueryString["id"]);
                        DataSet ds = bn.GetNews(nid);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            this.Title = string.Format("猎头网   人才网   招聘网   求职网   {0}—悬赏资讯：{1}", Application["webname"].ToString(), ds.Tables[0].Rows[0][0].ToString());
                            //ntitle, ntime,truename,ntname,ncontent,ntid                    
                            this.lbltitle.Text = ds.Tables[0].Rows[0][0].ToString();
                            this.lbltime.Text = "" + ds.Tables[0].Rows[0][1].ToString() ;
                            this.lblcome.Text = "" + ds.Tables[0].Rows[0][2].ToString();
                            this.lblcontent.Text = ds.Tables[0].Rows[0][4].ToString();
                        }
                    }
                    catch (Exception ex)
                    {


                    }

                }
                else
                {
                    if (dsn.Tables[0].Rows.Count > 0)
                    {
                        Response.Redirect("reward_news-" + dsn.Tables[0].Rows[0]["nid"] + ".html");
                    }
                }


            }

        }
    }
}